Support a new set of firmware update status messages #272
+97
−66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These new accepted Hub messages hook deeper into the updating lifecycle, as well as fixing issues where new firmware aren't sent to devices when an update is ignored or encounters errors.
This also moves the responsibility for rescheduling the update to Hub, which will resend the update shortly after the date sent by Link.
The new states sent to hub are:
:updating
(the progress is sent with this message):finalizing
(the download and applying of the update has finished and the device is about to reboot):ignored
(the device doesn't want the update. We could also allow a 'reason' to be sent):reschedule
(including the datetime to block device updates until):error
(something went wrong, a reason is also sent)Two things to discuss/consider:
finalizing
push to send a reply from hub, which allows us to make sure hub knows we are about to reboot, and thus track if a device updated by never came back online. I think, for consistency, we make all pushes tofirmware_update_status
return replies of:ok
, and then its up to Link to decide if it cares about them or not.Some bits to track